﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model dynamic
<style type="text/css">
    .gray-bg {
        background-color: white;
    }
</style>
<div class="wrapper wrapper-content animated fadeInUp">
    @{
        if (Model != null)
        {
            using (Ajax.BeginForm("UserRole", null, new AjaxOptions()
                           {
                               HttpMethod = "Post",
                               OnBegin = "SubAjax.Loading",
                               OnComplete = "SubAjax.Complate",
                               OnFailure = "SubAjax.Failure",
                               OnSuccess = "SubAjax.Success"
                           },
                               new { @class = "form-horizontal dig-from", @role = "form" }))
            {
                @Html.Hidden("UserId", ViewData["userId"])
                <div class="row">
                    <table class="table table-striped table-bordered table-hover dataTables-example" style="text-align:center;">
                        <thead>
                            <tr>
                                <th class="tn" style="width: 50px !important"><input name="checkall" class="icheck_box" type="checkbox" value=""  /></th>
                                <th>角色名称</th>
                                <th>所属系统</th>
                                <th>系统预置</th>
                            </tr>
                        </thead>
                        <tbody>
                            @{

                foreach (var item in Model)
                {
                    <tr>
                        <td class="tn">
                            @{
                    if (item.ID != Common.Enums.ClsDic.DicRole["超级管理员"])
                    {
                        <input name="checkbox_name" class="icheck_box" type="checkbox" value="@item.ID" @(item.IsChoosed ? "checked=\"checked\"" : "") />
                    }
                            }
                        </td>
                        <td>@item.ROLENAME</td>
                        <td>@item.SYSNAME</td>
                        <td>@Html.Raw(item.ISCUSTOMSTATUS)</td>
                    </tr>
                }

                            }
                        </tbody>
                    </table>
                    <div class="hr-line-dashed"></div>
                    <div class="text-center">
                        <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
                        <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="fa fa-reply-all"></i> 取消返回</button>
                    </div>
                </div>
            }
        }
    }
</div>
